//ES5  substr() substring() split()  slice()  indexOf()

let str = '1610B班';

console.log(str.substr(1,2));
console.log(str.substring(1,3)); //不包括结束的值
console.log(str.split('B'));
console.log(str.slice(1,3));
console.log(str.indexOf('A'));  //返回对应下标  -1

//ES6 

//trim 去掉左右空格  trimLeft trimRight 

//includes() //返回的是布尔值 startsWith(检测字符串)  endsWith()

//repeat

//padStart() padEnd()

//``模板字符串


console.log(`崔丽丽是${str.trimRight()}的。`);


console.log(str.includes('班'));

console.log(str.startsWith('班'));

let url = 'file:///D:/1610B-vue/day-01/src/index.html';

console.log(url.startsWith('file'));  //true

let imgUrl = '1.png';

console.log(imgUrl.endsWith('.jpg'));

console.log(str.repeat(3))  //重复的次数

//padStart()  //填充之后的总长度,填充的内容

console.log(str.padEnd(str.length+3,'@#'))




